export const checkPhone = (str) => {
  const targetStr = str.replace(/\s|&nbsp;/g, "")
  if (/^1(3|4|5|7|8)\d{9}$/.test(targetStr)) {
    return true
  } else {
    return false
  }
}

//判断是不是邮箱
export const checkEmail = (str) => {
  const targetStr = str.replace(/\s|&nbsp;/g, "") //先去除用户输入的无效字符
  const reg = /^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/
  if (reg.test(targetStr)) {
    return true
  } else {
    return false
  }
}
